package com.haojiang.mh.remote.widget

import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.RelativeLayout
import com.haojiang.mh.R
import com.haojiang.mh.remote.bean.ControlLeftMenuBean
import kotlinx.android.synthetic.main.item_control_left_menu.view.*


class ControlLeftMenuItemView : RelativeLayout {

    constructor(context: Context?) : super(context)
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    )

    init {
        View.inflate(context, R.layout.item_control_left_menu, this)
    }

    fun setData(data: ControlLeftMenuBean, isFocus: Boolean = false) {
        if(isFocus) {
            ivIcon.setImageResource(data.imageReroucePress)
//            ivLine.visibility = View.VISIBLE
        }else {
            ivIcon.setImageResource(data.imageRerouceNorm)
//            ivLine.visibility = View.INVISIBLE
        }
    }

}